package schedule.model;

import java.sql.*;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.Statement;

public class finalSchedule {
	public finalSchedule(){
		
	}
	
	public booleanSchedule findCommonMeetingTimes(booleanSchedule advisor, booleanSchedule student){
		booleanSchedule resultSchedule = new booleanSchedule();
		for (int count=0; count<56; count++){
			if(advisor.getAvailable(count) == true && student.getAvailable(count)==true){
				resultSchedule.setAvailable(count);
			}			
		}
		return resultSchedule;
	}
	
	public milTimeSchedule generateResultMilSchedule(milTimeSchedule studentDay, milTimeSchedule adviserDay, int minMeetTime){
		booleanSchedule studentBoolDay = new booleanSchedule();
		booleanSchedule adviserBoolDay = new booleanSchedule();
		booleanSchedule resultBool = new booleanSchedule();
		studentBoolDay.generateSchedule(studentDay);
		adviserBoolDay.generateSchedule(adviserDay);
		resultBool = findCommonMeetingTimes(studentBoolDay, adviserBoolDay);

		milTimeSchedule result = new milTimeSchedule();
		result = resultBool.getMilTimeSchedule(minMeetTime);
		return result;
	}
	public milTimeSchedule generateResultMilSchedule(milTimeSchedule studentDay, milTimeSchedule adviserDay){
		milTimeSchedule result = new milTimeSchedule();
		result = generateResultMilSchedule(studentDay, adviserDay, 30);
		return result;
	}
	
}
